<?php


namespace app\api\model\page\order;


use app\api\model\dao\OrderInfo;
use app\library\Error;
use app\library\PageBase;
use think\Exception;

class OrderListPage extends PageBase
{
    private $objOrderModel;

    public function __construct()
    {
        parent::__construct();
        $this->objOrderModel = new OrderInfo();
    }

    public function excute($param)
    {
        $ret = $this->checkToken($param);
        if (false === $ret) {
            header('Location:/home/loginpage');
            return $this->getRes(Error::ERR_NO_AUTH);
        }
        try {
            $ret = $this->objOrderModel->orderListPage();
        } catch (Exception $e) {
            return $this->getRes(Error::ERR_SYS, $e->getMessage());
        }
        $this->data = $ret;
        return $this->getRes();

    }
}